<?php namespace app\common\service;
use  \app\common\model\AuctionOrderTem as AuctionOrderTemModel;
use app\common\model\User;

/**
 * Class AuctionOrderTem
 * @package app\common\service
 */
class AuctionOrderTem extends Base{

    /**
     * AuctionOrderTem constructor.
     */
    public function __construct()
    {
        parent::__construct();
        $AuctionOrderTemModel= new AuctionOrderTemModel();
        $this->model = $AuctionOrderTemModel;
    }


    /**
     * @param $where
     * @param $page
     * @param int $limit
     * @return array
     */
    public function getList($where, $page, $limit=10){
        try{
            $data=$this->paginatet($where,'*','createtime desc',$limit,$page,'');

        }catch (\Exception $e){
            $data=[];
        }
        return $data;
    }

    /**
     * @param $data
     * @return array|bool
     */
    public function add($data)
    {
       try{
           $data= parent::add($data);
       }catch (\Exception $e){
           $data=[];
       }
       return $data;
    }


    /**
     * @param $map
     * @return array
     */
    public function find($map)
    {
        try{
            $data=parent::find($map);

        }catch (\Exception $e){
            $data=[];
        }
        return $data;
    }

    /**
     * @param array $map
     * @return int|string
     */
    public function count($map = [])
    {
        try{
            $number=$this->model->count();
        }catch (\Exception $e){
            $number=0;
        }
        return $number;
    }

    /**
     * 获取当条字段返回数组
     * @param $map
     * @param $filed
     * @return array
     */
    public function filed($map,$filed){
        try{
            $data=$this->model->where($map)->column($filed);
        }catch (\Exception $e){
            $data=[];
        }
        return $data;
    }


}